﻿@model IEnumerable<KRM.Core.vKRMRSCollectionAdmin>
@{
    ViewBag.Title = "Collections";
    Layout = "~/Views/Shared/_Layout.cshtml";
}


<div class="container-fluid">
    <fieldset>
        <legend>Filter by</legend>
        <form action="/rdm/collections" class="row-fluid">
            <div class="row-fluid">
                <div class="span5">
                    <div class="row-fluid">
                        <div class="span4">Claim Liability</div>
                        <div class="span8">@Html.DropDownList("LiabilityID")</div>
                    </div>
                    <div class="row-fluid">
                        <div class="span4">Date from</div>
                        <div class="span8">
                            <div class="datetimepicker input-append">
                                <input data-format="MM/dd/yyyy" type="text" name="datefrom" value="@DateTime.Now" >
                                <span class="add-on">
                                    <i data-time-icon="icon-time" data-date-icon="icon-calendar" class="icon-calendar"></i>
                                </span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="span5">
                    <div class="row-fluid">
                        <div class="span4">Status</div>
                        <div class="span8">@Html.DropDownList("StatusID")</div>
                    </div>
                    <div class="row-fluid">
                        <div class="span4">Date To</div>
                        <div class="span8">
                            <div class="datetimepicker input-append">
                                <input data-format="MM/dd/yyyy" type="text" name="dateto" value="@DateTime.Now" >
                                <span class="add-on">
                                    <i data-time-icon="icon-time" data-date-icon="icon-calendar" class="icon-calendar"></i>
                                </span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="span2">
                    <input type="submit" class="btn btn-primary" value="Search" />
                </div>
            </div>
        </form>
    </fieldset>
    <p>
        <input type="checkbox" disabled="disabled" checked="checked" style="float: left; margin-right: 10px;" />
        Restrict to top 100
    </p>
    <div style="max-height: 200px; overflow: auto; margin-bottom: 10px">
        <table class="table table-bordered table-fix tbl-selected">
            <thead>
                <tr>
                    <th>RDM Order Ref</th>
                    <th>Customer</th>
                    <th>Postcode</th>
                    <th>Order Item</th>
                    <th>Collection Items</th>
                    <th>Action</th>
                    <th>Date Placed</th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model)
                {
                    var suffix = "";
                    if (item.ActionID == 1)
                    {
                        suffix = " - Can only be completed by Logistics";
                    }
                    
                    <tr style="cursor: pointer" onclick="collectionselected(@item.CollectionID)"
                        title="@item.Action@suffix">
                        <td>@item.Order_Ref</td>
                        <td>@item.Customer</td>
                        <td>@item.Postcode</td>
                        <td>@item.Order_Item</td>
                        <td>@item.Collection_Items</td>
                        <td>@item.Action</td>
                        <td>@item.DatePlaced</td>
                    </tr>
                }
            </tbody>
        </table>

    </div>

    <form action="/rdm/savecollection" method="POST" class="margin0 fr-collectiondetail">
        <div class="row-fluid">
            <div class="span5">
                <fieldset>
                    <legend>Customer Details</legend>
                    <div class="row-fluid">
                        <div class="span4">Name</div>
                        <div class="span8">
                            <input type="text" class="input-block-level" />
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span2">Postcode</div>
                        <div class="span5">
                            <input type="text" class="input-block-level" />
                        </div>
                    </div>
                </fieldset>
                <fieldset>
                    <legend>Initial RDM</legend>
                    <div class="row-fluid">
                        <div class="span4">RDM Reason</div>
                        <div class="span8">
                            <input type="text" class="input-block-level" />
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span2">Liability</div>
                        <div class="span5">
                            <input type="text" class="input-block-level" />
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span2">RDM Items</div>
                        <div class="span5">
                            <input type="text" class="input-block-level" />
                        </div>
                    </div>
                    <div class="row-fluid">
                        Replacement Items
                        <textarea class="input-block-level"></textarea>
                    </div>
                    <div class="row-fluid">
                        <div class="span2">Signature</div>
                        <div class="span5">
                            <input type="text" class="input-block-level" />
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span2">Consignment No</div>
                        <div class="span5">
                            <input type="text" class="input-block-level" />
                        </div>
                    </div>
                </fieldset>
                <fieldset>
                    <legend>Return Details</legend>
                    <table class="table table-bordered table-fix">
                        <thead>
                            <tr>
                            <th>Date Received</th>
                            <th>ParcelContents</th>
                            <th>Condition</th>
                                </tr>
                        </thead>
                    </table>
                    <div class="row-fluid">
                        <div class="span2">Liability</div>
                        <div class="span5">
                            <input type="text" class="input-block-level" />
                        </div>
                    </div>
                </fieldset>
            </div>
            <div class="span7"></div>

        </div>
    </form>
</div>
